package milkyway.hightech.testit;

import java.io.IOException;

import java.util.Locale;

import java.util.ResourceBundle;

import milkyway.hightech.banking.BankImpl;
import milkyway.hightech.customer.BankCustomerView;
import milkyway.hightech.customergui.CustomerGUI;
import milkyway.hightech.logging.ProxyLogging;

/**
 *
 * @author michael
 */
public class TestIt
{
    /**
     *
     * @throws ClassNotFoundException
     * @throws InstantiationException
     * @throws IllegalAccessException
     */
    public TestIt() throws ClassNotFoundException, InstantiationException,
                           IllegalAccessException, IOException
    {
        Locale DE = new Locale("de", "DE");
        Locale UK = new Locale("en", "UK");
        
        BankImpl sparkasse = new BankImpl("Sparkasse", DE);
        BankImpl spardabank = new BankImpl("Spardabank", UK);
        
        BankCustomerView sparkasseProxy = ProxyLogging.newInstance(sparkasse);
        BankCustomerView spardabankProxy = ProxyLogging.newInstance(spardabank);
        
        ResourceBundle sparkasseRB = sparkasse.getRb();
        ResourceBundle spardabankRB = spardabank.getRb();
        
        new CustomerGUI(sparkasseProxy, sparkasseRB, sparkasse.getBankName());
        new CustomerGUI(spardabankProxy, spardabankRB, spardabank.getBankName());
    }
    
    /**
     * @param args
     * @throws IOException
     * @throws ClassNotFoundException
     * @throws InstantiationException
     * @throws IllegalAccessException
     * @throws NoSuchMethodException
     */
    public static void main(String[] args) throws IOException,
        ClassNotFoundException, InstantiationException,
        IllegalAccessException, NoSuchMethodException
    {
	new TestIt();
    }
}
